import java.util.ArrayList;
import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: AliceMana
 * Date: 2022-09-14
 * Time: 20:33
 */
class Student {
    public String name;
    public int age;
    public double score;

    public Student(String name, int age, double score) {
        this.name = name;
        this.age = age;
        this.score = score;
    }

    @Override
    public String toString() {
        return "Student{" +
                "name='" + name + '\'' +
                ", age=" + age +
                ", score=" + score +
                '}';
    }
}
public class Test {

    public static List<List<Integer>> generate(int numRows) {
        List<List<Integer>> arrayList = new ArrayList<>(numRows);
        for (int i = 0; i < numRows; i++) {
            List<Integer> list = new ArrayList<>(i+1);
            for (int j = 0; j <= i; j++) {
                if (j == 0 || j == i) {
                    list.add(1);
                } else {
                    list.add(arrayList.get(i-1).get(j) + arrayList.get(i-1).get(j-1));
                }
            }
            arrayList.add(list);
        }
        return arrayList;
    }

    public static void main(String[] args) {
        List<List<Integer>> retList = new ArrayList<>();
        retList = generate(5);
        for (List<Integer> integers : retList) {
            for (Integer integer : integers) {
                System.out.print(integer + " ");
            }
            System.out.println();
        }
    }
    public static void main2(String[] args) {
        ArrayList<Character> arrayList = new ArrayList<>();
        String s1 = "welcome to bit";
        String s2 = "come";
        for (int i = 0; i < s1.length(); i++) {
            boolean flg = false;
            for (int j = 0; j < s2.length(); j++) {
                if (s1.charAt(i) == s2.charAt(j)) {
                    flg = true;
                }
            }
            if (!flg) {
                arrayList.add(s1.charAt(i));
            }
        }
        for (int i = 0; i < arrayList.size(); i++) {
            System.out.print(arrayList.get(i) + "");
        }
    }

    public static void main1(String[] args) {
        Student student1 = new Student("zhangsan", 18, 55.5);
        Student student2 = new Student("lisi", 12, 60.5);
        Student student3 = new Student("wangwu", 55, 66);
        ArrayList<Student> students = new ArrayList<>(3);
        students.add(student1);
        students.add(student2);
        students.add(student3);
        for (Student s:
             students) {
            System.out.println(s);
        }
    }
}
